package com.mdoffice.utils;
import java.sql.Connection;
import java.sql.DriverManager;
public class DBConnection {
public static final String fileName="com.mdoffice.properties.sqlserverjdbc";
public static Connection getConnection()
{
Connection con=null;
try
{
String driver=PropertyReader.getValue(fileName, "driver");
String url=PropertyReader.getValue(fileName, "url");
String databaseName=PropertyReader.getValue(fileName, "databaseName");
String username=PropertyReader.getValue(fileName, "user");
String pass=PropertyReader.getValue(fileName, "pass");
String url1=url+";databaseName="+databaseName+";user="+username+";password="+pass;
Class.forName(driver);
con=DriverManager.getConnection(url,username,pass);
}
catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
return con;
}
public static void main(String[] args) {
	Connection con1=getConnection();
	System.out.println(con1);
	
}
}